package tx.bj12320.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.junit.Test;

import cn.org.rapid_framework.test.context.TestMethodContext;
import static junit.framework.Assert.*;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bj12320.model.*;
import tx.bj12320.dao.*;
import tx.bj12320.service.*;
import tx.bj12320.vo.query.*;


public class TszbProcessInfoManagerTest extends BaseManagerTestCase{

	private TszbProcessInfoManager manager;
	
	@Autowired
	public void setTszbProcessInfoManager(TszbProcessInfoManager manager) {
		this.manager = manager;
	}

    @Override
    protected String[] getDbUnitDataFiles() {
        //通过 TestMethodContext.getMethodName() 可以得到当前正在运行的测试方法名称
        return new String[]{"classpath:testdata/common.xml","classpath:testdata/TszbProcessInfo.xml",
                            "classpath:testdata/TszbProcessInfo_"+TestMethodContext.getMethodName()+".xml"};
    }

	//数据库单元测试前会开始事务，结束时会回滚事务，所以测试方法可以不用关心测试数据的删除
	@Test
	public void crud() {

		TszbProcessInfo obj = newTszbProcessInfo();
		manager.save(obj);
		manager.getEntityDao().flush();
		
		manager.update(obj);
		manager.getEntityDao().flush();
		
		assertNotNull(obj.getTszbProcessInfoId());
		
		manager.removeById(obj.getTszbProcessInfoId());
		manager.getEntityDao().flush();
	
	}
	
	public static TszbProcessInfo newTszbProcessInfo() {
		TszbProcessInfo obj = new TszbProcessInfo();
		
	  	obj.setOrgInfoId(new Long("1"));
	  	obj.setWorkOrderType(new java.lang.String("1"));
	  	obj.setCallerName(new java.lang.String("1"));
	  	obj.setCallerNumber(new java.lang.String("1"));
	  	obj.setAge(new java.lang.String("1"));
	  	obj.setSex(new java.lang.String("1"));
	  	obj.setEduDegreee(new java.lang.String("1"));
	  	obj.setCellPhone(new java.lang.String("1"));
	  	obj.setArea(new java.lang.String("1"));
	  	obj.setOccupation(new java.lang.String("1"));
	  	obj.setContaceAddress(new java.lang.String("1"));
	  	obj.setPhone(new java.lang.String("1"));
	  	obj.setRelaUnitName(new java.lang.String("1"));
	  	obj.setRelaUnitCode(new java.lang.String("1"));
	  	obj.setRelaPerson(new java.lang.String("1"));
	  	obj.setLiaisonMan(new java.lang.String("1"));
	  	obj.setLiaisonCellPhone(new java.lang.String("1"));
	  	obj.setHappenAddress(new java.lang.String("1"));
	  	obj.setUnitType(new java.lang.String("1"));
	  	obj.setUnitTypeDdValue(new java.lang.String("1"));
	  	obj.setDepartment(new java.lang.String("1"));
	  	obj.setLiaisonPhone(new java.lang.String("1"));
	  	obj.setHappenTime(new java.util.Date(System.currentTimeMillis()));
	  	obj.setPonderance(new java.lang.String("1"));
	  	obj.setPonderanceDdValue(new java.lang.String("1"));
	  	obj.setWorkOrderSource(new java.lang.String("1"));
	  	obj.setWorkOrderSourceDdValue(new java.lang.String("1"));
	  	obj.setZoneName(new java.lang.String("1"));
	  	obj.setZoneDdValue(new java.lang.String("1"));
	  	obj.setIncomingCallContent(new java.lang.String("1"));
	  	obj.setIsBeWorkOrder(new java.lang.String("1"));
	  	obj.setTimeLimit(new Long("1"));
	  	obj.setShoulliPerson(new java.lang.String("1"));
	  	obj.setShouliTime(new java.util.Date(System.currentTimeMillis()));
	  	obj.setChushenPerson(new java.lang.String("1"));
	  	obj.setShenhePerson(new java.lang.String("1"));
	  	obj.setReceiveDepartment(new java.lang.String("1"));
	  	obj.setReceivePerson(new java.lang.String("1"));
	  	obj.setReceiveTime(new java.util.Date(System.currentTimeMillis()));
	  	obj.setLeaderToshowContent(new java.lang.String("1"));
	  	obj.setLeaderToshowSign(new java.lang.String("1"));
	  	obj.setLeaderToshowTime(new java.util.Date(System.currentTimeMillis()));
	  	obj.setDealDepartment(new java.lang.String("1"));
	  	obj.setDealPerson(new java.lang.String("1"));
	  	obj.setDealTime(new java.util.Date(System.currentTimeMillis()));
	  	obj.setFeedbackRelaPersonTime(new java.util.Date(System.currentTimeMillis()));
	  	obj.setDealResult(new java.lang.String("1"));
	  	obj.setRelaPersonIdea(new java.lang.String("1"));
	  	obj.setThsiIsTrue(new java.lang.String("1"));
	  	obj.setIsImprove(new java.lang.String("1"));
	  	obj.setIsImproveText(new java.lang.String("1"));
	  	obj.setLeaderIssue(new java.lang.String("1"));
	  	obj.setLeaderIssueSign(new java.lang.String("1"));
	  	obj.setLeaderIssueTime(new java.util.Date(System.currentTimeMillis()));
	  	obj.setIsTrue(new java.lang.String("1"));
	  	obj.setWorkOrderSort(new java.lang.String("1"));
	  	obj.setWorkOrderSortDdValue(new java.lang.String("1"));
	  	obj.setResolveWay(new java.lang.String("1"));
	  	obj.setEventName(new java.lang.String("1"));
	  	obj.setEventHappenArea(new java.lang.String("1"));
	  	obj.setDetailAddress(new java.lang.String("1"));
	  	obj.setAffectPersonCount(new java.lang.String("1"));
	  	obj.setInvasionPersonCount(new java.lang.String("1"));
	  	obj.setDeathPersonCount(new java.lang.String("1"));
	  	obj.setProcInstId(new java.lang.String("1"));
	  	obj.setCurrActName(new java.lang.String("1"));
	  	obj.setProcStartTime(new java.util.Date(System.currentTimeMillis()));
	  	obj.setIsProcEnd(new Long("1"));
	  	obj.setProcEndTime(new java.util.Date(System.currentTimeMillis()));
	  	obj.setCurrSysUserType(new java.lang.String("1"));
	  	obj.setIsReject(new Long("1"));
	  	obj.setRejectTime(new java.util.Date(System.currentTimeMillis()));
		return obj;
	}
}
